<?php

namespace plugin\ycMassage\app\model;

use app\common\service\UploadService;

class MassageUserRealname extends Model
{
    public function getNicknameAttr($value)
    {
        return base64_decode($value);
    }
    public function getHeadimgAttr($value)
    {
        # 判断是否为url
        if (strpos($value, 'http') === 0) {
            return $value;
        }
        return $value ? UploadService::url($value) : '';
    }
    public function getFrontAttr($value)
    {
        return $value ? UploadService::url($value) : '';
    }
    public function setFrontAttr($value)
    {
        return UploadService::path($value);
    }
    public function getBackAttr($value)
    {
        return $value ? UploadService::url($value) : '';
    }
    public function setBackAttr($value)
    {
        return UploadService::path($value);
    }
}
